package com.hongyue.zuoTi5;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入文件");
        String a = sc.nextLine();
        String su = a.substring(a.length() - 5);
        if (su.equals(".java")) {
            System.out.println("是java文件");
        } else {
            System.out.println("不是java文件");
        }
        for (int i = 0; i < a.length(); i++) {
            if (a.charAt(i) == '.') {
                System.out.println("在字符串中"+i+"位置");
                break;
            }
        }
    }
}
